/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.cpal.entrenamiento.controller.util;

import com.cpal.entrenamiento.entity.ElementoMenu;
import java.util.LinkedList;
import org.zkoss.zul.DefaultTreeNode;
import org.zkoss.zul.TreeNode;

/**
 *
 * @author Omar
 */
public class ElementoMenuTreeNode extends DefaultTreeNode<ElementoMenu>{
   	private static final long serialVersionUID = 1L;
	int count;

	public ElementoMenuTreeNode(ElementoMenu elemento, int count) {
		super(elemento, new LinkedList<TreeNode<ElementoMenu>>()); // assume not a leaf-node
		this.count = count;
	}

	public String getDescription() {
		return getData().getDescripcion();
	}

	public int getCount() {
		return count;
	}

	public boolean isLeaf() {
		return getData() != null && getData().getHijos().isEmpty();
	}
}
